
<link rel="stylesheet" type="text/css" href="css/newDoc.css">
 <script src="js/libs/less.js" type="text/javascript"></script>       
 <script src="js/main.js" type="text/javascript"></script>       
 <script src="js/newDoc.js" type="text/javascript"></script>       

<div style="height:600px;">
<div class="widget">
    <div class="wHeader">
        <div class="headerText"><?php getLangText("Register New Document") ?></div>
        <div class="headerSwitch"><?php echo getLangText("Expand/Collapse")?></div>
    </div>
    <div class="wContent">
        <table>
        <tbody>
            <tr><th ><label for="dTitle"><?php echo getlangText("Title")?>&nbsp;</label></th>
                <td >
                    <input type="text" id="dTitle" size="100" value=""/>
                    <span class="errorMsg" ><?php getLangText("Please enter document title")?></span>
                </td>
            </tr>
            <tr><th ><label for="uDept"><?php echo getlangText("Department")?>&nbsp;</label></th>
                <td >
                     <?php 
                         $this->load->view('v_lib',Array('container'=>$dept,
                            'option_id'=>'Department',
                            'caption'=>'Department',
                            'fieldname'=>'depart_name'));                        
                    ?>                                        
                 </td>
            </tr>            
            <tr><th ><label for="dDocType"><?php echo getlangText("Document Type")?>&nbsp;</label></th>
                <td >
                     <?php 
                         $this->load->view('v_lib',Array('container'=>$docTypes,
                            'option_id'=>'DocumentType',
                            'caption'=>'Document Type',
                            'fieldname'=>'doc_type_desc'));                        
                    ?>                                        
                 </td>
            </tr>
            <tr><th ><label for="dDocGroup"><?php echo getlangText("Document Group")?>&nbsp;</label></th>
                <td >
                     <?php 
                         $this->load->view('v_lib',Array('container'=>$docGroups,
                            'option_id'=>'DocGroup',
                            'caption'=>'Document Group',
                            'fieldname'=>'group_name',
                            'DialogID'=>'newDocGroupDialog'));                        
                    ?>                       
                 </td>
            </tr>
            <tr><th >&nbsp;</label></th>
                <td >
                    <input type="checkbox" id="dRestricted" name="dRestricted" value="Restricted" />&nbsp;<?php echo getlangText('Restricted Access')?>
                </td>
            </tr>
            <tr><th ><label for="dRestricted"><?php echo getlangText("Notes")?>&nbsp;</label></th>
                <td >
                    <textarea id="dNotes" rows="5" cols="100"></textarea>
                    <br/><div  id="counter"></div>
                </td>
            </tr>
            <tr><th ><label for="dRestricted"><?php echo getlangText("RFID")?>&nbsp;</label></th>
                <td >
                    <input id="rfid" type="input" name="rfid" value="" /><button name="getRFID" type="button" onclick="onGetRFID();">Get RFID</button>
                </td>
            </tr>
        </tbody>
        </table>    
    </div> <!-- wContent-->                                
    <div class="wFooter">
        <div  class="saveChange" onclick="createNewDoc();"><?php getLangText("Save Changes");?>
            <span class="errorMsg" ></span>
        </div>  
    </div><!-- wFooter-->
</div> <!-- widget-->        
<div id="newDocGroupDialog" class="adhocDialog">
    <div class="widget">
        <div class="wHeader">
            <div class="headerText"><?php getLangText("Create new document group") ?></div>
        </div>
        <div class="wContent">
            <div style="font-size:15px;"><?php getLangText("Document group").':';?></div>
            <input type="text" id="docGroupName" style="width:90%;"name="docGroupName" size="50" value="" />
               <div class="dDept" >Department: <select id="dDepartment" name="dDepartment">:
                    <?php 
                        foreach($dept as $d)
                        {
                                echo "<option value=".$d->id." >".$d->depart_name."</option>";
                        }
                    ?>
                </select>         
                </div>
                <div style="display:inline-block;float:left;">
                    <input type="checkbox" id='dDocGroupRestricted' name="dDocGroupRestricted" value="Restricted" />&nbsp;<?php echo getlangText('Restricted Access')?>
                </div> 
                <div style="display:inline-block;margin-left:20px;">
                    <button  onclick="addNewDocGroup();"><?php getLangText("Add");?></button> 
                </div>
            <br/><hr />
            <table  border="2">
            <thead>
              <tr>
                <td>No</td><td><?php echo getlangText("Document Group")?></td><td><?php echo getlangText("Department")?></td><td><?php echo getlangText("Restricted")?></td>
              </tr>
            </thead>
            <tbody id="docGroupTable">
            </tbody>
          </table>
                      
        </div>
        <div class="wFooter">
            <div class="saveChange" onclick="saveNewDocGroup();"><?php getLangText("Save Changes");?></div>  
            <div class="saveChange" onclick="closeDialog();"><?php getLangText("Close");?></div>
        </div><!-- wFooter-->
    </div> <!-- widget-->
</div> <!-- newdocGroupDialog-->
</div>                            
<br/>
   